#include <stdio.h>
#ifndef _MAIN_C_
#define _MAIN_C_

#include <unistd.h>
#include "task.h"



void * counter_task(void * arg){
	int i;
	for(i=0;i<5;i++){
		printf("%d\n",i);
		task_cooperate();
		
	}
	return NULL;
}


void * counter_task2(void * arg){
	int i;
	for(i=0;i<12;i++){
		printf("%d\n",i);
		task_cooperate();
		
	}
	return NULL;
}



void * main_task(void * arg){
	
	task_t t1, t2;
	task_create(&t1,counter_task,NULL);
	task_create(&t2,counter_task2,NULL);
	task_wait();
	return;
}

int main(){
pthread_t t;
pthread_create(&t,NULL,main_task,NULL);
pthread_join(t,NULL);
return 0;
}
#endif
